<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="jt.classic.system.group.IGroup"%>
<%@ page import="jt.classic.system.user.IUser"%>
<%@ page import="org.limp.mine.Label"%>
<%@ page import="org.limp.mine.Controller"%>
<%@ page import="org.limp.mine.DateTrimmer"%>
<%@ page import="jt.classic.system.wordbook.XWordbook"%>
<%@ page import="jt.classic.system.wordbook.XWordbookQuery"%>
<%
	String context = jt.classic.system.ISystem.getContextPath();
	Object[] result = (Object[]) request.getAttribute("result");
	Label label = (Label) result[1];
	Controller controller = (Controller) result[2];
	String pageNO = (String) result[3];
	List resultList = (List) result[0];

	Map query = (Map) request.getAttribute("query");

	List list = (List) request.getAttribute("list");

	String qname = (String) query.get("qname");
	String qsdate = (String) query.get("qsdate");
	String qedate = (String) query.get("qedate");

	XWordbookQuery noonquery = (XWordbookQuery) request
			.getAttribute("noonquery");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>领导日程列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<jsp:include page="../head.jsp"></jsp:include>
<script language="javascript">
  var chk = false;
  function checkall(thizz){
    var chks = document.getElementsByTagName("input");
    for(var i=0;i<chks.length;i++){
      if(chks[i].type == "checkbox"){
        chks[i].checked = !chk;
      }
    }
    
    chk = !chk;
  }
  
  /*function handleDelete(){
    var rnt = false;
    var ids = "";
    var chks = document.getElementsByTagName("input");
    for(var i=0;i<chks.length;i++){
      if(chks[i].type == "checkbox" && chks[i].checked){
        rnt = true;
        ids += chks[i].value + ",";
      }
    }
    
    if(!rnt){
      alert("请选择要删除信息");
    }else if(confirm("删除信息")){
      createHidden("ids",ids.substring(0,ids.length - 1));
      document.form1.action = "<%=context%>/app/info.do?method=delete";
      document.form1.submit();
    }
  }*/
  
  function handleQuery(){
      document.form1.action = context + "/app/ldrc.do?method=query";
      document.form1.submit();
  }
  
  function handleReresh(){
      window.location.href = context + "/app/ldrc.do?method=query&pageNO=<%=pageNO%>";
  }
  
  function handleView(id){
      var url = context + "/app/ldrc.do?method=view&id=" + id; 
      top.xwin(this,url,true,"",200,300);
  }
  
  function handleInsert(){
      window.location.href =  context + "/app/ldrc.do?method=neu"; 
  }
  
  function handleEdit(id){
      window.location.href = context + "/app/ldrc.do?method=edit&id=" + id; 
  }
  
  function handleDelete(id){
      if(confirm("确定删除")){
         window.location.href = context + "/app/ldrc.do?method=delete&id=" + id;
      }
  }
  
  function handleSelect(s){
      var url = context + "/app/info.do?method=directorytree&select=true";
      dialog(url,true,"选择所属栏目",300,350);
  }
  
  function responseResult(ids,names,types){
      document.form1.qdirec.value = names;
      
      closeDialog();
  }
</script>
<body>
<form name="form1" method="post" action=""><input type="hidden"
	name="pageNO" value="<%=pageNO%>">
<div style="padding-left:5px;margin-top:15px;">
领导姓名 <input type="text"
			name="qname" class="box3" value="<%=qname%>" style="width:100px;">
		开始时间 <input type="text" class="box3" name="qsdate" value="<%=qsdate%>"
			readonly style="width:100px;" onclick="javascript:HS_setDate(this);">
		结束时间 <input type="text" class="box3" name="qedate" value="<%=qedate%>"
			readonly style="width:100px;" onclick="javascript:HS_setDate(this);">
		<img src="/app/info/images/search.png" title="查询领导日程信息" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleQuery();"/>
</div>
<table class="tbl" align="center" width="98%">
    <thead>
	<tr>
		<td class="td1 title="全部选择/取消选择"  nclick="javascript:checkall();"
			width="10" align="center">&nbsp;</td>
		<td class="td1" width="10%"  align="center">&nbsp;开始时间</td>
		<td class="td1" width="10%" align="center">&nbsp;结束时间</td>
		<td class="td1" width="20%" align="center">&nbsp;领导</td>
		<td class="td1" width="20%"  align="center">&nbsp;活动内容</td>
		<td class="td1" width="10%" align="center">&nbsp;地点</td>
		<td class="td1" width="10%" align="center">&nbsp;主办单位</td>
		<td class="td1" width="15%" align="center">&nbsp;陪同人员</td>
	</tr>
	</thead>
	<%
			if (resultList != null && !resultList.isEmpty()) {
			for (int i = 0; i < resultList.size(); i++) {
				Map info = (Map) resultList.get(i);
				String number = (String) info.get("PAGINATION_NUMBER");
				String id = (String) info.get("ID");
				String chld = (String) info.get("CHLD");
				String zbdw = (String) info.get("ZBDW");
				String sdate = (String) info.get("SDATE");
				String snoon = (String) info.get("SNOON");
				if (snoon.equals("")) {
			sdate = DateTrimmer.getYMDHM_LBL(sdate);
				} else {
			sdate = DateTrimmer.getYMD_LBL(sdate) + "&nbsp;"
					+ noonquery.query(snoon).getName();
				}
				String edate = (String) info.get("EDATE");
				String enoon = (String) info.get("ENOON");
				if (enoon.equals("")) {
			edate = DateTrimmer.getYMDHM_LBL(edate);
				} else {
			edate = DateTrimmer.getYMD_LBL(edate) + "&nbsp;"
					+ noonquery.query(enoon).getName();
				}
				String hdnr = (String) info.get("HDNR");
				String hddd = (String) info.get("HDDD");
				String ptry = (String) info.get("PTRY");
	%>
	<tr onMouseOver="javascript:this.bgColor='#ffff99'"
		onmouseout=" javascript:this.bgColor='#ffffff'" bgColor="#ffffff">
		<td align="center"><!--<input type="checkbox" name="chk" value="<%=id%>">--><%=number%>
		</td>
		<td align="center">&nbsp;<%=sdate%></td>
		<td align="center">&nbsp;<%=edate%></td>
		<td align="center">&nbsp;<a href="javascript:handleView('<%=id%>');"><%=chld%></a></td>
		<td align="center">&nbsp;<%=hdnr%></td>
		<td align="center">&nbsp;<%=hddd%></td>
		<td align="center">&nbsp;<%=zbdw%></td>
		<td align="center">&nbsp;<%=ptry%></td>
	</tr>
	<%
		}
		}
	%>
</table>
<table width="98%" class="tab-noborder" align="center">
	<tr>
		<td><%=label.displayLabel()%></td>
		<td align="right"><%=label.startLabel()%> <%=label.previousLabel()%>
		<%=label.nextLabel()%> <%=label.endLabel()%> <%=controller.getController().toString()%>
		</td>
	</tr>
</table>
<%=controller.getControlScript(true)%></form>
</body>
</html>
